package com.iknow.xmpp.extention;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.jivesoftware.smack.packet.IQ;

public class SessionIQ extends IQ
{
  private Map<String, String> attributes = new HashMap();

  public Map<String, String> getAttributes()
  {
    return this.attributes;
  }

  public String getChildElementXML()
  {
    Iterator localIterator;
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<session_bind xmlns=\"http://www.imiknow.com/iks/xmpp/iq/session_bind\" ");
    if ((this.attributes != null) && (this.attributes.size() > 0))
      localIterator = this.attributes.keySet().iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        localStringBuilder.append("/>");
        return localStringBuilder.toString();
      }
      String str1 = (String)localIterator.next();
      String str2 = (String)this.attributes.get(str1);
      localStringBuilder.append(str1).append("=");
      localStringBuilder.append("\"").append(str2).append("\"");
    }
  }

  public String getField(String paramString)
  {
    return ((String)this.attributes.get(paramString));
  }

  public void setSesssionID(String paramString)
  {
    this.attributes.put("sid", paramString);
  }
}